1. Field of the Invention
The present invention relates to a numerical controller controlling a 5-axis machine tool that machines a workpiece set on a table using three linear axes and two rotation axes, more particularly to a numerical controller having a workpiece setting error compensation means for compensating a setting error arising during setting of a workpiece.
2. Description of the Related Art
A workpiece is fixed by a jig to make machining by a machine tool easy. However, use of the jig causes error (offset) in setting of a workpiece on a machine tool, so such setting error needs to be compensated.
The method for compensating such setting error is disclosed in, for example, U.S. Pat. No. 5,661,654. The technology disclosed in this U.S. Patent relates to the compensation of error in setting of a workpiece in a numerical controller that carries out concurrent 5-axis control of the tool relative to a workpiece attached to a jig. The positions and directions of the tool in the workpiece coordinate system are determined on the basis of numerical commands and preset amounts of error are compensated in the determined directions. Then, the coordinates of the five axes that meet the compensated tool positions and tool directions are obtained and, based on the obtained coordinates, a numerical control command is given to the driving means of each axis.
In the above U.S. Patent, the arctangent function is used to calculate a position on the B-axis or A-axis. However, the arctangent function generally has two solutions in the angular range of 0 to 360 degrees, so the compensated position on the B-axis or A-axis cannot be determined uniquely.
In addition, the compensated position obtained in this way is generally different from a command position and it may be impossible to move to the compensated position depending on the machine structure or the like. For example, when the A-axis is a table tilting axis as described in the above U.S. Patent, it is generally impossible to move to any angle in the angular range of 0 to 360 degrees. In other words, the command position is generally output by Computer Aided Manufacturing (CAM); the operable range can be set by CAM and the command position is determined within the operable range by CAM. However, the compensated position obtained by a numerical controller is generally different from the command position, so it may be impossible to move to the compensated position depending on the machine structure or the like. Alternatively, an attempt to move to an unmovable position can cause an over travel alarm or a machine breakage unexpectedly.